/**
 * Created by zhouqian on 2017/4/18.
 */
var React = require('react');

module.exports = React.createClass({
    getInitialState: function (){
        return {

        }
    },
    componentDidMount: function () {
        setTimeout(this.swp,500);
    },
    /**轮播*/
    swp:function(){
        var swiper = new Swiper('.swiper-container', {
            autoplay: 3000,
            loop:false,
            grabCursor: true,
            paginationClickable: true,
            autoplayDisableOnInteraction:true
        });
    },

    render: function () {
        var goods_img = this.props.goods_img;
        if(goods_img) {
            var goods_imgList = goods_img.map(function (obj,index) {
                return (
                    <div key={index} className="swiper-slide">
                        <img src={obj}/>
                    </div>
                )
            });
        }
        return (
            <div className="swiper-container">
                <div className="swiper-wrapper">
                    {goods_imgList}
                </div>
            </div>
        )
    }
});